#include "func_widget.h"
#include "can_rx.h"
#include <Windows.h>
#include "main.h"
#include "operate_parm.h"
#include "pump_operate_upload.h"
#include "windows.h"
#include "ada_parm_data_set.h"
#include "udp_thread.h"



func_widget::func_widget(QWidget* parent) : QWidget(parent)
{

}

unsigned int can_connect_finish = 0;
void func_widget::eth_connect(bool rsvd)
{

    unsigned long long ipthread = 0;
    udp_stop = 0;
    HANDLE my_handle;
    my_handle = CreateThread(NULL , 0 , udp_process , NULL , 0 ,(LPDWORD)&ipthread);

    emit this->disable_can_connect_button(1);
}

void func_widget::eth_disconnect(bool rsvd)
{
    udp_stop = 1;

}





void func_widget::fight_parm_set(bool rsvd)
{

    udp_fight_parm_set();

}



unsigned int output_operate_flag = 0;
void func_widget::output_operate(int cmd)
{
    output_operate_flag = cmd;

}


void func_widget::output_strong_light(bool rsvd)
{
    udp_output_strong_light();

}

void func_widget::output_red_light(bool rsvd)
{
    udp_output_red_light();
}

void func_widget::output_week_1_light(bool rsvd)
{
    udp_output_week_1_light();
}

void func_widget::output_week_2_light(bool rsvd)
{
    udp_output_week_2_light();
}

void func_widget::stop_light(bool rsvd)
{
    udp_stop_light();
}




void func_widget::reset(bool rsvd)
{
    udp_reset();

}


unsigned int fight_pre_operate_flag = 0;
void func_widget::set_fight_operate_flag(int cmd)
{
    fight_pre_operate_flag = cmd;

}

void func_widget::hot_standby(bool rsvd)
{
    udp_hot_standy_pre();

}

void func_widget::cold_standby(bool rsvd)
{
    udp_cold_standy_pre();
}

void func_widget::udp_start_connect(bool rsvd)
{
    udp_connect();
}

void func_widget::udp_exec_disconnect(bool rsvd)
{
    udp_disconnect();
}

void func_widget::udp_start_parm_upload(bool rsvd)
{
    udp_upload_start();
}



void func_widget::withdraw(bool rsvd)
{
    udp_withdraw();

}


void func_widget::slave_adaptor_parm_set(bool rsvd)
{
    udp_slave_adaptor_set();
}

void func_widget::slave_adaptor_parm_store(bool rsvd)
{
    udp_slave_adaptor_store();
}

void func_widget::slave_adaptor_parm_init(bool rsvd)
{
    udp_slave_adaptor_init();
}

void func_widget::master_adaptor_parm_set(bool rsvd)
{
    udp_master_adaptor_set();
}

void func_widget::master_adaptor_parm_store(bool rsvd)
{
    udp_master_adaptor_store();
}

void func_widget::master_adaptor_parm_init(bool rsvd)
{
    udp_master_adaptor_init();
}

void func_widget::slave_adaptor_parm_load(bool rsvd)
{
    slave_adaptor_parm_data_load();
}






void func_widget::ada_parm_store(bool rsvd)
{
    //udp_adaptor_store();


}

void func_widget::ada_parm_init(bool rsvd)
{
    //udp_adaptor_init();


}









void func_widget::ada_parm_query(bool rsvd)
{
    udp_adaptor_query();
}


void func_widget::operate_parm_query(bool rsvd)
{
    udp_operate_query();

}

void func_widget::enter_debug(bool rsvd)
{
    udp_enter_debug();

}

void func_widget::exit_debug(bool rsvd)
{
    udp_exit_debug();

}


void func_widget::enter_week_light_mode(bool rsvd)
{
    udp_enter_week_light_mode();
}

void func_widget::exit_week_light_mode(bool rsvd)
{
    udp_exit_week_light_mode();
}





static string str_tmp_1;

void func_widget::checkbox_checked_0(int state)
{


}

void func_widget::checkbox_checked_1(int state)
{

}

void func_widget::checkbox_checked_2(int state)
{


}


void func_widget::checkbox_checked_3(int state)
{


}


void func_widget::start_pump_tx(bool rsvd)
{
    HANDLE my_handle;
    unsigned long long ipthread = 0;
    my_handle = CreateThread(NULL , 0 , pump_operate_parm_upload , NULL , 0 ,(LPDWORD)&ipthread);


}





